home *** CD-ROM | disk | FTP | other *** search
/ MACD 5 / MACD 5.bin / workbench / libs / unixlib.lha / unix / src / mkdir.c < prev    next >
C/C++ Source or Header  |  1996-01-04  |  398b  |  22 lines

  1.  
  2. #include "amiga.h"
  3. #include <stdarg.h>
  4.  
  5. int mkdir(char *name, mode_t mode)
  6. {
  7.     BPTR lock;
  8.     long amode;
  9.  
  10.     __chkabort();
  11.  
  12.     if (lock = CreateDir(name)) {
  13.     UnLock(lock);
  14.     /* We remove script because mode 777 contains it by def, but it is
  15.        meaningless for directories */
  16.     amode = _make_protection(mode) & ~(FIBF_SCRIPT);
  17.     if (SetProtection(name, amode))
  18.         return 0;
  19.     }
  20.     ERROR;
  21. }
  22.